const SortArrayByKeys = (dataSource: any[], sortKeys: SortItemType[]) => {
  for (let i = 0; i < sortKeys.length; i++) {
    dataSource.sort((a, b) => {
      let _a = a[sortKeys[i].key]
      let _b = b[sortKeys[i].key]
      return sortKeys[i].order * (_a >= _b ? 1 : -1)
    })
  }
  return dataSource
}

export default SortArrayByKeys
